expand
container.expanding_array.expand
expand(n i64,filler Function unit) => container.this.expanding_array T¶[src]
Precondition
pre debug: n >= 0
Arguments
filler Function unit¶[src]
0.099dev (GIT hash e2d5298d8107bb5fe79600fdb06a49bc75756344)
pre debug: n >= 0
This is useful if the new elements will not be added in order or if the new
elements need to be moved around, e.g., for sorting.
`filler` will be run with an instated instance of `container.expanding T`
that will permit to set the new elements. During the execution of `filler`
elements that have been set already (i.e., indices <length or those for
which `set []` or `put` was called) maybe be read using `get` or `index []`.
`filler` may set elements repeatedly, but it must set all elements for the
new indices `length`..`length+n-1` before it returns.
expand is not thread-safe.